﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataModel
{
    public class UserEventsFeedback
    {
        private DBTools dbTools;

        private decimal id;
        private decimal id_Event;
        private Guid id_User;
        private string mark;
        private string note;

        //for holding nice strings
        private string userName;
        private string eventTitle;

        public UserEventsFeedback()
        {
            dbTools = new DBTools();
        }

        public decimal Id
        {
            get { return id; }
            set { id = value; }
        }

        public decimal Id_Event
        {
            get { return id_Event; }
            set { id_Event = value; }
        }

        public Guid Id_User
        {
            get { return id_User; }
            set { id_User = value; }
        }

        public string Mark
        {
            get { return mark; }
            set { mark = value; }
        }

        public string Note
        {
            get { return note; }
            set { note = value; }
        }

        public string UserName
        {
            get 
            {
                if (dbTools != null && this.id_User != Guid.Empty)
                {
                    userName = dbTools.GetUserNameById(this.id_User);
                }
                return userName; 
            }
            set { userName = value; }
        }

        public string EventTitle
        {
            get 
            {
                if (dbTools != null && this.id_Event > 0)
                {
                    eventTitle = dbTools.GetEventFromId(this.id_Event).Title;
                }
                return eventTitle; 
            }
            set { eventTitle = value; }
        }

    }
}
